<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  </head>

  <body>
    <div id="app">
      <div>水果列表</div>
      <ul>
        <li v-for="(item,index) in fruits"  v-text ='item +"------"+ index'></li>
        <!-- key 的作用是帮助我们的vue来提高性能，对我们的开发没有任何的影响 -->
        <li :key='index' v-for="(item,index) in myfruits" >
          <span>{{item.ename}}</span>
          <span>+++++++</span>
          <span>{{item.cname}}</span>
        </li>
      </ul>
      <button v-on:click="handle">切换</button>
    </div>
    <script type="text/javascript">
      const vm = new Vue({
        el: "#app",
        data: {
          fruits: ["apple", "orange", "banana"],
          myfruits:[{
            ename:'apple',
            cname:'苹果'
          },{
            ename:'orange',
            cname:'橘子'
          },{
            ename:'banana',
            cname:'香蕉'
          },]
        },
        methods: {
          handle: function () {},
        },
      });
    </script>
  </body>
</html>
